import xhr from '../request';


export type commitParams = {
  Cover: string,
  SceneParam: { MaterialId: number[] },
  Status: 1 | 2,
  Title: string
}

export type WorksListRow = {
  Cover: string,
  CreatedAt: string,
  DeletedAt: string | null,
  ID: number,
  MemberId: number,
  Status: number,
  Title: string
  UpdatedAt: string | null
}

export type WorksList = {
  Data: WorksListRow[];
  Page: number;
  PageSize: number;
  Total: number

}

export default {

  listForPage(params: { Page: number, PageSize: number, Keyword: string, Status: number }) {
    return xhr.request<WorksList>({ method: 'get', url: '/V1/Works/ListForPage', params })
  },

  commit(data: commitParams) {
    return xhr.request({ method: 'post', url: '/V1/Works/Commit', data })
  },


  delete(data: { Ids: number[] }) {
    return xhr.request({ method: 'post', url: '/V1/Works/Delete', data });
  },


};
